function index(tbl){
	var pageNumber=1;
	if(tbl.pageNumber!=undefined){
		pageNumber=tbl.pageNumber
	}
	var pager=$pager("zan",Cnd.where("1","=",1).desc("id"),pageNumber,10)
	var courses=$list("course",Cnd.where("1","=",1).desc("id"),1,6)
	attr("courses",courses)
	return pager;
}
function my(tbl){
	if(user()==null){
		return ">>:login?goto=zan/my"
	}
	var pageNumber=1;
	if(tbl.pageNumber!=undefined){
		pageNumber=tbl.pageNumber
	}
	var pager=$pager("zan",Cnd.where("user_id","=",user().id).desc("id"),pageNumber,10)
	var courses=$list("course",Cnd.where("1","=",1).desc("id"),1,6)
	attr("courses",courses)
	return pager;
}
function zan(tbl){
	
	var zan=$fetch("zan",Cnd.where("id","=",tbl.id))
	$update({table:'zan',bnum:zan.bnum+1,id:zan.id})
	var u=$fetch("users",Cnd.where("id","=",zan.user_id))
	if(u==null){
		u=new JseMap();
	}
	u.put("count",$count("zan",Cnd.where("user_id","=",zan.user_id)))
	attr("u",u)
	var zus=$list("zan_user",Cnd.where("zid","=",tbl.id));
	zus.forEach(function(z){
		z.put("user",$fetch("users",Cnd.where("id","=",z.user_id)))
	})
	attr("zus",zus)
	var zms=$list("zan_msg",Cnd.where("zid","=",tbl.id));
	zms.forEach(function(z){
		z.put("user",$fetch("users",Cnd.where("id","=",z.user_id)))
	})
	attr("zms",zms)
	var zans=$list("zan",Cnd.where("1","=",1).desc("num"),1,6)
	attr("zans",zans)
	return zan;
}